package Others.DesignPattern.StrategyPattern.Original.SimpleFactory;

public class CollectMoneyFactory {

    public static CollectMoney createCollectMoney(String type) {

        return switch (type) {
            case "正常" -> new NormalCollectMoney();
            case "打八折" -> new DiscountCollectMoney(0.8);
            case "满300返现100" -> new RebateCollectMoney(300, 100);
            default -> null;
        };
    }
}
